dna1 = "AGT", dna2 = "AGCT"


function solution(dna1, dna2) {
    let Hash1 = {}
    let Hash2 = {}
    let len1 = dna1.length
    let len2 = dna2.length
    for (let i = 0; i < len1; i++) {
        if (Hash1[dna1[i]] === undefined) {
            Hash1[dna1[i]] = 1
        } else {
            Hash1[dna1[i]]++
        }
    }
    for (let j = 0; j < len2; j++) {
        if (Hash2[dna2[j]] === undefined) {
            Hash2[dna2[j]] = 1
        } else {
            Hash2[dna2[j]]++
        }
    }
    for (let key in Hash1) {
        if (Hash2[key]) { }
    }

    console.log(Hash1, Hash2);
}
console.log(solution(dna1, dna2));

